// import * as actionTypes from './constants'
import { fromJS } from 'immutable'
import * as canstants from './constants'
import { constants } from '.'

const defaultState = fromJS({
  widthTf: 0,
  bookListData: [],// 书籍列表
})

export default (state = defaultState, action) => {
  switch (action.type) {
    case canstants.CHANGE_WIDTH_TF:
      return state.set('widthTf',action.val)
    case constants.GET_BOOK_LIST:
      return state.set('bookListData', action.list)
    default:
      return state
  }
}
